

.reference-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding: 0.5rem;
  max-height: 100%;
  overflow-y: auto;
  background: #fafbfc;
}

.reference-item {
  flex: 0 0 auto; 
  background: #ffffff;
  border: 1px solid #e1e5e9;
  border-radius: 12px;
  padding: 1.25rem;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 3px rgba(27, 31, 35, 0.04);
  position: relative;
  overflow: hidden;
}

.reference-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, #007aff, #5ac8fa);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.reference-item:hover::before {
  opacity: 1;
}

.reference-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.875rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #f1f3f5;
}

.reference-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: #24292f;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 65%;
  line-height: 1.4;
  letter-spacing: -0.01em;
}

.reference-meta {
  font-size: 0.75rem;
  color: #6e7781;
  text-align: right;
  line-height: 1.3;
}

.reference-dimensions {
  display: block;
  margin-bottom: 0.125rem;
  font-weight: 500;
  color: #2f3542;
}

.reference-date {
  display: block;
  font-size: 0.7rem;
  opacity: 0.75;
  color: #8b949e;
}

.reference-item img {
  width: 100%;
  height: auto;
  max-height: 220px;
  object-fit: contain;
  border-radius: 8px;
  background: #f8f9fa;
  border: 1px solid #eaeef2;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 2px rgba(27, 31, 35, 0.04);
}

.reference-buttons {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
}

.reference-buttons button {
  flex: 1;
  padding: 0.625rem 1rem;
  border: 1.5px solid;
  border-radius: 8px;
  background: #ffffff;
  color: #24292f;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  letter-spacing: -0.01em;
  position: relative;
  overflow: hidden;
  min-height: auto;
  line-height: normal;
}

.reference-buttons button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  transition: left 0.5s ease;
}

.reference-buttons button:hover::before {
  left: 100%;
}

.reference-buttons button:hover {
  background: #f8f9fa;
  border-color: #afb8c1;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(27, 31, 35, 0.04);
}

.reference-buttons button:active {
  transform: translateY(0);
  box-shadow: none;
}

.reference-buttons button:first-child {
  background: #007aff;
  color: white;
  border-color: #007aff;
}

.reference-buttons button:first-child:hover {
  background: #0056d6;
  border-color: #0056d6;
  box-shadow: 0 2px 8px rgba(0, 122, 255, 0.3);
}

.reference-buttons button:last-child {
  background: #ffffff;
  color: #ff3b30;
  border-color: #ff3b30;
}

.reference-buttons button:last-child:hover {
  background: #ff3b30;
  color: white;
  box-shadow: 0 2px 8px rgba(255, 59, 48, 0.3);
}

.reference-list:empty::before {
  content: "暂无参考图片";
  display: block;
  text-align: center;
  padding: 4rem 1rem;
  color: #8b949e;
  font-size: 0.9rem;
  font-style: italic;
  background: #f8f9fa;
  border-radius: 12px;
  border: 1px dashed #e1e5e9;
  margin: 0.5rem;
}

.reference-list::-webkit-scrollbar {
  width: 6px;
}

.reference-list::-webkit-scrollbar-track {
  background: #f6f8fa;
  border-radius: 3px;
}

.reference-list::-webkit-scrollbar-thumb {
  background: #d0d7de;
  border-radius: 3px;
  border: 1px solid #f6f8fa;
}

.reference-list::-webkit-scrollbar-thumb:hover {
  background: #afb8c1;
}

.floating-window.is-minimized .reference-list,
.floating-window.is-minimized .floating-window__body,
.floating-window.is-minimized .floating-window__resizer {
  display: none;
}

.floating-window.is-minimized {
  min-width: 135px !important;
  min-height: 70px !important;
  max-width: 135px !important;
  max-height: 70px !important;
  resize: none;
  background: #ffffff;
  border: 1px solid #e1e5e9;
  box-shadow:
    0 8px 24px rgba(27, 31, 35, 0.12),
    0 0 0 1px rgba(27, 31, 35, 0.08);
  border-radius: 16px;
}

.floating-window.is-minimized .floating-window__header {
  height: 100%;
  padding: 0;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  border-radius: 16px;
}

.floating-window.is-minimized .floating-window__title {
  writing-mode: horizontal-tb;
  text-orientation: mixed;
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
  color: #24292f;
  overflow: hidden;
  flex: 1;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.floating-window:not(.is-minimized) .floating-window__actions {
  display: flex !important;
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
}

.floating-window:not(.is-minimized) .floating-window__actions button {
  margin: 0;
  padding: 0.375rem 0.75rem;
  font-size: 0.75rem;
  line-height: 1;
  min-height: 28px;
  border: 1px solid #e1e5e9;
  border-radius: 6px;
  background: #ffffff;
  color: #6e7781;
  transition: all 0.15s ease;
  cursor: pointer;
  white-space: nowrap;
  display: flex;
  align-items: center;
  justify-content: center;
}

.floating-window:not(.is-minimized) .floating-window__actions button:hover {
  background: #f6f8fa;
  border-color: #d0d7de;
  color: #24292f;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(27, 31, 35, 0.04);
}

.floating-window.is-minimized .floating-window__actions {
  display: flex !important;
  flex-direction: row;
  align-items: center;
  gap: 0.25rem;
  flex-shrink: 0;
}

.floating-window:not(.is-minimized) .floating-window__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background: #ffffff;
  border-bottom: 1px solid #e1e5e9;
  cursor: move;
  user-select: none;
}

.floating-window:not(.is-minimized) .floating-window__title {
  font-size: 1rem;
  font-weight: 600;
  color: #24292f;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.floating-window:not(.is-minimized) .floating-window__actions {
  display: flex !important;
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
}

.floating-window:not(.is-minimized) .floating-window__actions button {
  margin: 0;
  padding: 0.375rem 0.75rem;
  font-size: 0.75rem;
  line-height: 1;
  min-height: 28px;
  border: 1px solid #e1e5e9;
  border-radius: 6px;
  background: #ffffff;
  color: #6e7781;
  transition: all 0.15s ease;
  cursor: pointer;
  white-space: nowrap;
  display: flex;
  align-items: center;
  justify-content: center;
}

.floating-window:not(.is-minimized) .floating-window__actions button:hover {
  background: #f6f8fa;
  border-color: #d0d7de;
  color: #24292f;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(27, 31, 35, 0.04);
}

.floating-window.is-minimized .floating-window__actions button {
  margin: 0 0 0 3px;
  padding: 0.25rem 0.5rem;
  font-size: 0.7rem;
  line-height: 1;
  min-height: auto;
  min-width: auto;
  border: 1px solid #e1e5e9;
  border-radius: 6px;
  background: #ffffff;
  color: #6e7781;
  transition: all 0.15s ease;
  font-weight: 500;
  white-space: nowrap;
  width: auto;
  flex: none;
}

.floating-window.is-minimized .floating-window__actions button:hover {
  background: #f6f8fa;
  border-color: #d0d7de;
  color: #24292f;
  box-shadow: 0 2px 4px rgba(27, 31, 35, 0.04);
}

.floating-window.is-minimized .floating-window__actions button:first-child:hover {
  background: #007aff;
  color: white;
  border-color: #007aff;
}

.floating-window.is-minimized .floating-window__actions button:last-child:hover {
  background: #ff3b30;
  color: white;
  border-color: #ff3b30;
}


.reference-item img[src=""] {
  display: none;
}

.reference-item:not(:has(img[src])) {
  background: #f8f9fa;
  border-style: dashed;
  border-color: #e1e5e9;
  opacity: 0.8;
}

.reference-item img:not([src]),
.reference-item img[src=""],
.reference-item img[src^="data:"]:not([src*="base64"]) {
  background: #f8f9fa;
  border: 2px dashed #e1e5e9;
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #8b949e;
  font-size: 0.8rem;
  position: relative;
}

.reference-item img:not([src])::after,
.reference-item img[src=""]::after,
.reference-item img[src^="data:"]:not([src*="base64"])::after {
  content: "图片加载中...";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #8b949e;
  font-style: italic;
}

.floating-window.is-dragging {
  transition: none !important;
  will-change: transform;
  box-shadow:
    0 16px 32px rgba(27, 31, 35, 0.16),
    0 0 0 1px rgba(0, 122, 255, 0.2) !important;
  z-index: 1000;
}

.floating-window {
  transition:
    transform 0.2s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  background: #ffffff;
  border: 1px solid #e1e5e9;
  border-radius: 16px;
  box-shadow:
    0 8px 24px rgba(27, 31, 35, 0.12),
    0 0 0 1px rgba(27, 31, 35, 0.08);
  overflow: hidden;
}


.reference-empty {
  text-align: center;
  padding: 3rem 2rem;
  color: #8b949e;
  font-size: 0.9rem;
  background: #f8f9fa;
  border-radius: 12px;
  border: 1px dashed #e1e5e9;
  margin: 0.5rem;
  line-height: 1.5;
}

.reference-empty::before {
  content: "📷";
  display: block;
  font-size: 2rem;
  margin-bottom: 1rem;
  opacity: 0.6;
}


@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.reference-item {
  animation: slideInUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.reference-item:nth-child(1) {
  animation-delay: 0.05s;
}

.reference-item:nth-child(2) {
  animation-delay: 0.1s;
}

.reference-item:nth-child(3) {
  animation-delay: 0.15s;
}

.reference-item:nth-child(4) {
  animation-delay: 0.2s;
}

.reference-item:nth-child(5) {
  animation-delay: 0.25s;
}

.reference-set-button {
  background: #1a73e8;
  padding: 10px 16px;
  border-radius: 4px;
  border: none;
  color: white;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.reference-set-button:hover {
  background: #1669d6;
}

.reference-delete-button {
  background: transparent;
  border: 1px solid #dadce0;
  padding: 10px 16px;
  border-radius: 4px;
  color: red;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.reference-delete-button:hover {
  background: #f1f3f4;
}